class PromotionEntityEntity {
  PromotionEntityData data;
  int code;
  String msg;

  PromotionEntityEntity({this.data, this.code, this.msg});

  PromotionEntityEntity.fromJson(Map<String, dynamic> json) {
    data = json['data'] != null ? new PromotionEntityData.fromJson(json) : null;
    code = json['code'];
    msg = json['msg'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    if (this.data != null) {
      data['data']['list'] = this.data.toJson();
    }
    data['code'] = this.code;
    data['msg'] = this.msg;
    return data;
  }
}

class PromotionEntityData {
  List<PromotionEntityDataData> datas;

  PromotionEntityData();

  PromotionEntityData.fromJson(Map<String, dynamic> json) {
    if (json['data'] != null) {
      datas = new List<PromotionEntityDataData>();
      if (json['data'] is List) {
        (json['data'] as List).forEach((v) {
          datas.add(new PromotionEntityDataData.fromJson(v));
        });
      } else {
        (json['data']['list'] as List).forEach((v) {
          datas.add(new PromotionEntityDataData.fromJson(v));
        });
      }
    }
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    if (this.datas != null) {
      data['list'] = this.datas.map((v) => v.toJson()).toList();
    }
    return data;
  }
}

class PromotionEntityDataData {
  String id;
  String user_id;
  String check_id;
  String group_id;
  String pay_amount;
  String status;
  String pay_name;
  String pay_type;
  String create_time;
  String update_time;
  String note;
  String group_name;
  String username;
  String referrer_nickname;
  String status_zh;
  PromotionEntityDataData(
      {this.id,
      this.user_id,
      this.check_id,
      this.update_time,
      this.group_id,
      this.username,
      this.pay_amount,
      this.note,
      this.group_name,
      this.status,
      this.pay_name,
      this.pay_type,
      this.create_time});

  PromotionEntityDataData.fromJson(Map<String, dynamic> json) {
    id = json['id'].toString();
    user_id = json['user_id'].toString();
    referrer_nickname = json['referrer_nickname'];
    status_zh = json['status_zh'];
    if (json['referrer'] == null) {
      check_id = "无邀请人";
    } else {
      check_id =
          json['referrer']['username'].toString() + json['referrer']['phone'];
    }
    group_id = json['group_id'].toString();
    pay_amount = json['pay_amount'];
    status = json['status'].toString();
    group_name = json['group_name'];
    username = json['nickname'];
    update_time = json['update_time'].toString().replaceAll("\\", "");
    pay_name = json['pay_name'].toString().replaceAll("\\", "");
    pay_type = json['pay_type'].toString().replaceAll("\\", "");
    note = json['note'];
    create_time = json['create_time'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['id'] = this.id;
    data['user_id'] = this.user_id;
    data['check_id'] = this.check_id;
    data['group_id'] = this.group_id;
    data['pay_amount'] = this.pay_amount;
    data['status'] = this.status;
    data['note'] = this.note;
    data['update_time'] = this.update_time;
    data['pay_type'] = this.pay_type;
    data['pay_name'] = this.pay_name;
    data['create_time'] = this.create_time;

    return data;
  }
}
